package com.managementSystem.client.view;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.managementSystem.client.presenter.MainMenuPresenter;

public class MainMenuView extends Composite implements MainMenuPresenter.Display {
	public MainMenuView() {
		DecoratorPanel contentTableDecorator = new DecoratorPanel();
		initWidget(contentTableDecorator);
		contentTableDecorator.setWidth("100%");
		contentTableDecorator.setWidth("6em");
		
		contentTable = new FlexTable();
		contentTable.setWidth("100%");
		contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListContainer");
		contentTable.getCellFormatter().setWidth(0, 0, "100%");
		contentTable.getFlexCellFormatter().setHorizontalAlignment(0, 0, DockPanel.ALIGN_CENTER);
		approveButton = new Button("Approve");
		searchButton = new Button("Search");
		profileButton = new Button("Profile");
		VerticalPanel hPanel = new VerticalPanel();
	    hPanel.setBorderWidth(0);
	    hPanel.setSpacing(0);
	    hPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
	    hPanel.add(approveButton);
	    hPanel.add(profileButton);
	    hPanel.add(searchButton);
		contentTable.setWidget(0, 0, hPanel);
	    contentTableDecorator.add(contentTable);
	}
	@Override
	public Widget asWidget() {
		return this;
	}

	@Override
	public HasClickHandlers getApproveButton() {
		return approveButton;
	}

	@Override
	public HasClickHandlers getProfileButton() {

		return profileButton;
	}

	@Override
	public HasClickHandlers getSearchButton() {
		return searchButton;
	}
	private final Button approveButton;
	private final Button searchButton;
	private final Button profileButton;
	private final FlexTable contentTable;
}
